//
//  LHQButtonTableViewCell.m
//  God_is_a_Girl
//
//  Created by dllo on 15/9/25.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LHQButtonTableViewCell.h"

@implementation LHQButtonTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self =[ super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.segment = [[UISegmentedControl alloc]init];
        NSArray *segmentArray = [[NSArray alloc] initWithObjects:@"景点", @"酒店", nil];
        
        self.segment = [[UISegmentedControl alloc] initWithItems:segmentArray];
        self.segment.frame = CGRectMake(0, 0, self.contentView.frame.size.width*2 , self.contentView.frame.size.height);
        self.segment.backgroundColor = [UIColor whiteColor];
        [self.segment setTitle:@"旅行地点" forSegmentAtIndex:0];
        [self.segment setTitle:@"精品游记" forSegmentAtIndex:1];
        self.segment.layer.borderColor = (__bridge CGColorRef)([UIColor  lightGrayColor]);
        [self.contentView  addSubview:self.segment];
        
        self.label = [[UILabel  alloc] init];
       
        self.label.frame = CGRectMake(100, self.contentView.frame.size.height-self.segment.frame.size.height-20, self.contentView.frame.size.width, 40);
        [self.contentView  addSubview:self.label];
 
    }

    return self;

}

-(void)layoutSubviews
{
    [super  layoutSubviews];
    self.segment.frame = CGRectMake(0, 0, self.contentView.frame.size.width , self.contentView.frame.size.height-self.contentView.frame.size.height*0.55);
     self.label.frame = CGRectMake(0, self.contentView.frame.size.height-self.segment.frame.size.height, self.contentView.frame.size.width, 40);
    self.label.textAlignment = 1;
     [self.label setFont:[UIFont fontWithName:@"Helvetica-Bold" size:17]];
    
}


















- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
